Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust how ArchetypeAccess tracks mutable & immutable deps #660

Merged
merged 1 commit into from
Oct 15, 2020

Conversation

mjhostet
Copy link
Contributor

ArchetypeAccess was tracking immutable and mutable separately.
This means that checking is_compatible requires three checks:
m+m, m+i, i+m.

Instead, continue tracking mutable accesses, but instead of
immutable track immutable | mutable as another accessed bit mask.
This drops the comparisons to two (m+a, a+m) and turns out to be
what the rest of the code base wants too, unifying various duplicated
checks and loops.

`ArchetypeAccess` was tracking `immutable` and `mutable` separately.
This means that checking is_compatible requires three checks:
m+m, m+i, i+m.

Instead, continue tracking `mutable` accesses, but instead of
`immutable` track `immutable | mutable` as another `accessed` bit mask.
This drops the comparisons to two (m+a, a+m) and turns out to be
what the rest of the code base wants too, unifying various duplicated
checks and loops.
@memoryruins memoryruins added the A-ECS Entities, components, systems, and events label Oct 12, 2020
@cart
Copy link
Member

cart commented Oct 15, 2020

Nice catch. I dig it!

@cart cart merged commit 871790c into bevyengine:master Oct 15, 2020
joshuajbouw pushed a commit to joshuajbouw/bevy that referenced this pull request Oct 24, 2020
…ine#660)

`ArchetypeAccess` was tracking `immutable` and `mutable` separately.
This means that checking is_compatible requires three checks:
m+m, m+i, i+m.

Instead, continue tracking `mutable` accesses, but instead of
`immutable` track `immutable | mutable` as another `accessed` bit mask.
This drops the comparisons to two (m+a, a+m) and turns out to be
what the rest of the code base wants too, unifying various duplicated
checks and loops.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants